@layout("/common/_container.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal">

            <div class="row">
                <#input  type="hidden" id="id" name="" value="${item.id}" />
                <div id="loading" style="color:#ffffff; display:none; position:absolute; top:80px; left:3em;"></div>
                <div class="col-sm-6 b-r">
                    <#input id="names" name="姓名" value="${item.name}" underline="true"/>
                     <#input id="department" name="卡号" value="${item.department}" />
                </div>

                <div class="col-sm-6">
                     <#input  id="starttime" name="开始时间" value="${item.starttime}" underline="true"/>
                      <#input id="stoptime" name="截止日期" value="${item.stoptime}" underline="true"/>
                </div>
                <div class="col-sm-12" id="checkbox">

                </div>
            </div>

            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CarInfoDlg.editSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CarInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<script src="${ctxPath}/static/modular/doorCars/car/car_info.js"></script>
<script>
    laydate.render({
        elem: '#starttime',
        type: 'datetime',
        choose:function (datas) {
            alert(datas);
        }
    });
    laydate.render({
        elem: '#stoptime',
        type: 'datetime',
        choose:function (datas) {
            alert(datas);
        }
    });
    var arr = new Array();
    $.ajax({
        url: "/device/list",//获取数据的URL
        type: "Get",//HTTP请求方法
        async: false,
        success: function (data) {
            var deviceMap = new Map();
            var deviceObject = {};
            for (var i=0; i<data.length;i++){
                $("#checkbox").append(" <p style='display:inline-block; width: 20%;'><input type='checkbox' id='"+data[i].name+"' name='category' value='"+data[i].name+"' />"+data[i].name+"</p>");
                deviceMap.set(data[i].id,data[i].name);
            }
            var doorName = new Array();
            $.ajax({
                url:"/car/detail/"+$("#id").val(),
                type:"get",
                async:false,
                success:function(data1){
                    doorName = data1.model.split(",");
                 }
            })/*car/list*/
            for(var j=0;j<doorName.length;j++){
                $("#"+doorName[j]+"").attr("checked",true);
            }
        }
    });/*/device/list*/


</script>
@}

